{extend name="public/common"} {block name="body"}
<title>基本设置</title>
<style>
	.suglist{
		max-height:400px;
		border: 1px solid #e5e5e5;
		width: 148px;
		display:none;
		overflow-y:hidden;
		position: absolute;
	}
	.suglist li:hover{
		background: #f3f3f3;
	}
	.suglist li{
		padding-left:10px;
		cursor: pointer; 
	}
	 
</style>
</head>
<div style="padding:30px 20px;height:30px;">
    <h1 style="line-height:30px;float:left;font-size:18px;margin:10px 10px;padding:0;"> 会员资料</h1>
</div>
  
  <form action="" enctype="multipart/form-data" method="post" id="supply_form">
    <div class="tabCon" style="display: block;">
				<div class="row cl" style="margin:10px 0px;">
					<label class="form-label col-xs-2 col-sm-2" style="margin-left:40px;">
						会员账号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input style="width:150px;" type="text" value="{$dl.username}" disabled="disabled" class="input-text"><strong style="color:#999999">&nbsp;&nbsp;会员关联的唯一凭证，禁止修改</strong>
					</div>
				</div>
				<div class="row cl" style="margin:10px 0px;">
					<label class="form-label col-xs-2 col-sm-2" style="margin-left:40px;">
						原推荐人/代理：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input style="width:150px;" type="text" value="{$dl.tjr}" name="ytjr" disabled="disabled" class="input-text"><strong style="color:#999999">&nbsp;&nbsp;原代理/推荐人名称</strong>
					</div>
				</div> 
		 		<div class="row cl" style="margin:10px 0px;" id="deputy">
					<label class="form-label col-xs-2 col-sm-2" style="margin-left:40px;">
						推荐人/代理：</label>
					<div class="formControls col-xs-8 col-sm-9">
					<input id="supply" style="width:150px;" type="text" value="" name="xg_tjr" class="input-text aa" autocomplete="off">
					<strong style="color:#999999;position: relative;">&nbsp;&nbsp;修改会员代理，会员之前的数据将不会转移，未选择表示不变更。</strong>
					<ul class="suglist">
					{volist name="dllist" id="it" key="key"}
						<li {if condition="$key==1"}class="cur"{/if}>{$it.username}</li>
					{/volist}
					</ul>
					</div>
				</div> 
				
				
    
    <div class="am-margin" style="margin-top:60px;">
  <input type="submit" style="margin-left:55px;" class="btn btn-danger radius"  value="提交保存" />
    <button type="button" onclick="javascript:history.go(-1);" style="margin-left:30px;" class="btn btn-primary radius">放弃保存</button>
  </div>
  </div>
  </form>
  <div>
    
  </div>
{/block} 
{block name="js"}
<script type="text/javascript">23
$('#supply').bind('input propertychange', function() {
	var val = $(this).val();
	$(".suglist li").css("display","none");
	$(".suglist li:contains("+val+")").show();
}); 

$(".suglist").on('click','li',function(){
	var text = $(this).text();
	$("#supply").val(text);
	$(".suglist").css('display','none');
})
$("#supply").focus(function(){
	$(".suglist").css('display','block');
   })
   
   
$(document).click(function(e){
  var _con = $('#deputy');  
  if(!_con.is(e.target) && _con.has(e.target).length === 0){
	  $(".suglist").css('display','none');
  }
});
$("#supply_form").submit(function(){
	var tjr = $("#supply").val();
	if(tjr == ''){
		layer.msg('推荐人不能为空！', {icon: 5});
		return false;
	}
})
</script>
{/block}
